package com.atguigu.boot.config;

import com.atguigu.boot.entity.Dog;
import com.atguigu.boot.entity.MyBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import java.util.UUID;

/**
 * @ClassName Config
 * @Description 此类描述:
 * @Author dangchen
 * @DateTime 2022-09-13 19:04
 * @Version 1.0
 */
@Configuration
@Import(MyBeanConfig.class)
public class Config {

    @Bean
    public Dog myDog(){
        return new Dog(1,"柯基"+ UUID.randomUUID().toString());
    }

    //@ConditionalOnBean(name = "myDog")
    /*@Bean
    public MyBean myBean(){
        return new MyBean(3,"MyBean--ok");
    }*/
}
